home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / music / 87 / c / aline.h next >
C/C++ Source or Header  |  1986-12-19  |  27KB  |  555 lines

  1.         /***********************************************\
  2.         *                        *
  3.         *                aline.h            *
  4.         *    Common include file for C interface    *
  5.         *    to low level Line A calls        *
  6.         *                        *
  7.         *    J.R. Bammi                *
  8.         *      decvax!cwruecmp!bammi            *
  9.         *      bammi%case@csnet-relay.ARPA        *
  10.         *      bammi@case.CSNET            *
  11.         *                        *
  12.         \***********************************************/
  13.  
  14. #include "compiler.h"        /* Compiler dependant defines    */
  15.                 /* Defines things like WORD, LONG etc */
  16.  
  17. /*****************************************************************************\
  18. *                                                                      *
  19. *                                 Defines                                     *
  20. *                                          *
  21. \*****************************************************************************/
  22.  
  23. /*
  24.  *  Object colors (default pallette)
  25.  *
  26.  */
  27. #define WHITE    0
  28. #define BLACK    1
  29. #define RED      2
  30. #define GREEN    3
  31. #define BLUE     4
  32. #define CYAN     5
  33. #define YELLOW   6
  34. #define MAGENTA  7
  35. #define LWHITE   8
  36. #define LBLACK   9
  37. #define LRED     10
  38. #define LGREEN   11
  39. #define LBLUE    12
  40. #define LCYAN    13
  41. #define LYELLOW  14
  42. #define LMAGENTA 15
  43.  
  44.  
  45. /* 
  46.  * Vdi writing modes
  47.  *
  48.  */
  49. #define MD_REPLACE 1
  50. #define MD_TRANS   2
  51. #define MD_XOR     3
  52. #define MD_ERASE   4
  53.  
  54.  
  55. /*
  56.  * Raster Op Codes
  57.  *
  58.  */
  59. #define ALL_WHITE  0
  60. #define S_AND_D    1
  61. #define    S_AND_NOTD 2
  62. #define S_ONLY     3
  63. #define NOTS_AND_D 4
  64. #define    D_ONLY     5
  65. #define S_XOR_D    6
  66. #define S_OR_D     7
  67. #define    NOT_SORD   8
  68. #define    NOT_SXORD  9
  69. #define D_INVERT  10
  70. #define    NOT_D     11
  71. #define    S_OR_NOTD 12
  72. #define NOTS_OR_D 13
  73. #define    NOT_SANDD 14
  74. #define ALL_BLACK 15
  75.  
  76. /*
  77.  * Sprite formats
  78.  *
  79.  */
  80. #define SP_VDI        0
  81. #define SP_XOR        1
  82.  
  83. /*
  84.  * Line A Opcodes
  85.  *
  86.  */
  87. #define    INIT        0
  88. #define PUTPIXEL    1
  89. #define GETPIXEL    2
  90. #define LINE        3
  91. #define HLINE        4
  92. #define RECTANGLE    5
  93. #define FPOLYGON    6
  94. #define BITBLT        7
  95. #define TEXTBLT        8
  96. #define SHOWMOUSE    9
  97. #define HIDEMOUSE    10
  98. #define TRANMOUSE    11
  99. #define USPRITE        12
  100. #define DSPRITE        13
  101. #define CPYRASTER    14
  102. #define FSEEDFILL    15    /* ROM TOS only    */
  103.  
  104.  
  105.  
  106.  
  107. /*****************************************************************************\
  108. *                                                                      *
  109. *                                 Types                                       *
  110. *                                          *
  111. \*****************************************************************************/
  112.  
  113.     /* A pointer to the type LINEA is returned by the Line A init call
  114.      * ($A000), in registers A0 and D0.
  115.          * This pointer is saved in the global variable 'linea'.
  116.      *
  117.      */
  118. typedef struct {
  119.  
  120. /* Type    Name       Offset   Function            Comments              */
  121. /* -------------------------------------------------------------------------  */
  122.    WORD   VPLANES;    /*  0  # of Planes     Also see CurrRez             */
  123.    WORD      VWRAP;      /*  2  Bytes / scan line    "    "    "                 */
  124.               /*     VWRAP can be changed to implement special effects*/
  125.               /*     Doubling VWRAP will skip every other scan line   */
  126.               /*                                  */
  127.               /*                                                      */
  128.    WORD      *CONTRL;    /*  4  Ptr to CONTRL Array  Contrl gets set to this     */
  129.    WORD      *INTIN;     /*  8  Ptr to INTIN  Array  Intin  gets set to this     */
  130.    WORD      *PTSIN;     /* 12  Ptr to PTSIN  Array  Ptsin  gets set to this     */
  131.    WORD   *INTOUT;    /* 16  Ptr to INTOUT Array  Intout gets set to this     */
  132.    WORD   *PTSOUT;    /* 20  Ptr to PTSOUT Array  Ptsout gets set to this     */
  133.               /*     CONTRL is the control array              */
  134.               /*     INTIN is the array of input parameters          */
  135.               /*     PTSIN is the array of input coordinates          */
  136.               /*      Even entrys are X coordinate              */
  137.               /*       Odd  entrys are corresponding Y coodinates  */
  138.               /*     INTOUT is the array of output parameters         */
  139.               /*     PTSOUT is the array of output coordinates        */
  140.               /*    organizes like PTSIN.                  */
  141.               /*                                  */
  142.    WORD   COLBIT0;    /* 24  Plane 0 Color Value  All Three Rez's          */
  143.    WORD   COLBIT1;    /* 26  Plane 1 Color Value  Med and Low Rez only          */
  144.    WORD      COLBIT2;    /* 28  Plane 2 Color Value  Low Rez only               */
  145.    WORD   COLBIT3;    /* 30  Plane 3 Color Value  Low Rez Only               */
  146.               /*     Foreground color COLBIT0 + 2*COLBIT1 + 4*COLBIT2 */
  147.               /*                  + 8*COLBIT3              */
  148.               /*                                  */
  149.               /*                                                      */
  150.    WORD      LSTLIN;     /* 32  Always set to -1, Done for you in Init_Aline     */
  151.               /*     Does anyone know what it is supposed to be?      */
  152.               /*                                  */
  153.    WORD   LNMASK;     /* 34  Linemask used when drawing lines, same as Vdi's  */
  154.               /*     line style                                       */
  155.               /*                                  */
  156.    WORD      WMODE;      /* 36  Writing mode                                     */
  157.               /*     0=Replace Mode-Replace all bits in Dest with src */
  158.               /*     1=Trans. Mode-Only additional bits in src set(OR)*/
  159.               /*     2=Xor Mode- Src XOR Dest                  */
  160.               /*     3=Inverse Trans.- (NOT src) Or Dest              */
  161.               /*     Values upto 16 are permitted                     */
  162.               /*                                  */
  163.    WORD   X1;          /* 38  X1 coordinate used in various calls              */
  164.               /*                                  */
  165.    WORD   Y1;         /* 40  Y1 coordinate used in various calls              */
  166.               /*                                  */
  167.    WORD   X2;         /* 42  X2 coordinate used in various calls              */
  168.               /*                                  */
  169.    WORD   Y2;         /* 44  Y2 coordinate used in various calls              */
  170.               /*                                  */
  171.               /*                                                      */
  172.    WORD   *PATPTR;    /* 46  Pointer to current fill pattern                  */
  173.                       /*     Must be integral power of 2 (words) in length    */
  174.    WORD   PATMSK;     /* 50  I don't know why they call it a mask. It is in   */
  175.               /*     reality the length in words of the current patt. */
  176.    WORD   MFILL;      /* 52  Multi Plane fill flag 1 == Current fill Pattern  */
  177.               /*     is for Muti Plane.                               */
  178.               /*                                                      */
  179.               /*                                                      */
  180.    WORD   CLIP;       /* 54  Clipping Flag 1 == TRUE                          */
  181.    WORD   XMINCL;     /* 56  Min X of clipping window                  */
  182.    WORD   YMINCL;     /* 58  Min Y of clipping window                         */
  183.    WORD   XMAXCL;     /* 60  Max X of clipping window                  */
  184.    WORD   YMAXCL;     /* 62  Max Y of clipping window                         */
  185.               /*                                                      */
  186.               /*                                                      */
  187.    WORD   XDDA;       /* 64  Accumulator for Scaling, Must be set to 0x08000  */
  188.                       /*     before each call to Text Blt. Done for you in    */
  189.               /*     in aline_text()                                  */
  190.    WORD   DDAINC;     /* 66  Scaling factor - Fractional amount to scale char */
  191.               /*     When scaling up = 256 *(Size-Textsize)/Textsize  */
  192.               /*     When scaling down = 256*(Size)/Textsize          */
  193.               /*     scaling down does not work                       */
  194.    WORD   SCALDIR;    /* 68  Scaling direction 0 == down                      */
  195.    WORD   MONO;       /* 70  Mono flag 0== current font is a propotional font */
  196.               /*     Its Ok for Thickening to increase the width of   */
  197.               /*     the current character.                           */
  198.               /*     1 == current font is mono spaced, so thickening  */
  199.               /*     may not increase the width of the current char   */
  200.               /*                                                      */
  201.    WORD   SOURCEX;    /* 72  X coordinate of character in the font form       */
  202.               /*     SOURCEX is caluclated from info in the font      */
  203.               /*     header for the current font (see FONT_HEAD type) */
  204.               /*     SOURCEX = off_table[char-first_ade]          */
  205.               /*     SOURCEX is calculated for you in aline_text()    */
  206.               /*     The pointer to a table of font header for the    */
  207.               /*     internal fonts is returned in A2 on init (A000)  */
  208.    WORD   SOURCEY;    /* 74  Y coodinate of character in the font form        */
  209.               /*     Typically set to 0 (top line of font form)          */
  210.    WORD   DESTX;      /* 76  X coordinate of character on screen              */
  211.    WORD   DESTY;      /* 78  Y coordinate of character on screen              */
  212.    WORD   DELX;       /* 80  Width of Character                      */
  213.               /*     Difference between two SOURCEX's                  */
  214.    WORD   DELY;       /* 82  Height of Character                              */
  215.               /*     form_height field of FONT_HEAD of current font   */
  216.    WORD   *FBASE;     /* 84  Pointer to start of font form                    */
  217.    WORD   FWIDTH;     /* 88  Width of the current font's form                 */
  218.               /*                                                      */
  219.    WORD   STYLE;      /* 90  Vector of style flags                  */
  220.               /*     Bit 0 = Thicken Flag                  */
  221.               /*     Bit 1 = Lighten Flag                  */
  222.               /*     Bit 2 = Skewing Flag                  */
  223.               /*     Bit 3 = Underline Flag (ignored)              */
  224.               /*     Bit 4 = Outline Flag                  */
  225.               /*                                                      */
  226.    WORD   LITEMASK;   /* 92  Mask used for lightening text                */
  227.               /*     The Mask is picked up from the font header       */
  228.    WORD   SKEWMASK;   /* 94  Mask used for skewing text                  */
  229.               /*     The Mask is picked up from the font header       */
  230.    WORD   WEIGHT;     /* 96  The number of bits by which to thicken text      */
  231.               /*     The number is picked up from the font header     */
  232.    WORD   ROFF;       /* 98  Offset above baseline when skewing               */
  233.                       /*     Again picked up from the font header             */
  234.    WORD   LOFF;       /* 100 Offset below character baseline when skewing     */
  235.                       /*     Again picked up from the font header             */
  236.               /*                                                      */
  237.    WORD   SCALE;      /* 102 Scaling Flag 1 == true                           */
  238.               /*                                                      */
  239.    WORD   CHUP;          /* 104 Character rotation vector.                       */
  240.                  /*     0 = normal (0 degrees)                  */
  241.               /*     1800 = 180 degrees                      */
  242.                     /*     2700 = 270 degrees                               */
  243.               /*                                                      */
  244.    WORD   TEXTFG;     /* 106 Text foreground color                  */
  245.               /*                                                      */
  246.    char   *SCRTCHP;   /* 108 Address of buffer required for creating special  */
  247.               /*     text effects. The size of this buffer should be  */
  248.               /*     1K according the Internals. The Atari document   */
  249.               /*     of course does not talk about such things :-)    */
  250.                       /*                                                      */
  251.    WORD   SCRPT2;     /* 112 The offset of the scaling buffer buffer in above */
  252.                       /*     buffer. Internals suggests an offset of 0x0040   */
  253.                       /*     As usual the Atari document does'nt say a thing  */
  254.                       /*                                                      */
  255.    WORD   TEXTBG;     /* 114 Text background color (Ram Vdi only)             */
  256.                       /*     used for the BitBlt writing modes (4-19) only    */
  257.                       /*                                                      */
  258.    WORD   COPYTRAN;   /* 116 Copy raster form type flag (Ram vdi only)        */
  259.                       /*     0 => Opaque type                                 */
  260.                       /*          n-plane source  ->  n-plane dest            */
  261.                       /*              BitBlt writing modes (4-19)             */
  262.                       /*    ~0 => Transparent type                            */
  263.                       /*          1-plane source  ->  n-plane dest            */
  264.                       /*              Vdi writing modes (1-3)                 */
  265.                       /*                                                      */
  266.    WORD(*SEEDABORT)();/* 118 Pointer to function returning int, which is      */
  267.                       /*     called by the fill logic to allow the fill to    */
  268.                       /*     be aborted. If the routine returns FALSE (0)     */
  269.                       /*     the fill is not aborted. If it returns TRUE (~0) */
  270.                       /*     the fill is aborted                              */
  271. /* -------------------------------------------------------------------------  */
  272.  
  273. } LINEA;              /*       P H E W !!!!!                                  */
  274.  
  275.  
  276.     /*
  277.      * Global Variables at negative offsets from the Line A parameter
  278.      * block address returned by init.
  279.      *
  280.      */
  281. /* Offset    Type    Description                          */
  282. /* -------------------------------------------------------------------------- */
  283. /* -4         W    Max Y pixel screen value                  */
  284. /* -6         W    Text Status byte                      */
  285. /* -10         L    Font offset table address                  */
  286. /* -12         W    Max X pixel screen value                  */
  287. /* -14         W    Font Width                          */
  288. /* -16         W    First font ASCII code (first_ade)              */
  289. /* -18         W    Last  font ASCII code (last_ade )                     */
  290. /* -22         L    Font address                          */
  291. /* -23         B    Cursor countdown timer                      */
  292. /* -24         B    Cursor flash interval                      */
  293. /* -26         W    Y cursor position                      */
  294. /* -28           W    X cursor position                      */
  295. /* -30         W    Offset to first cell                      */
  296. /* -34         L    Current cursor address                      */
  297. /* -36         W    Foreground color index                      */
  298. /* -38         W    Background color index                      */
  299. /* -40         W    Offset to next cell                      */
  300. /* -42           W    Max cells high - 1                      */
  301. /* -44         W    Max cells across - 1                      */
  302. /* -46         W    Cell height in pixels                      */
  303. /* -------------------------------------------------------------------------- */
  304.  
  305. /*
  306.  * Atari did'nt specify any names for these variables
  307.  * so i invented them!
  308.  *
  309.  */
  310. #define MAXY        *((WORD  *)((char  *)aline + (char  *) -4L))
  311. #define TEXTSTATUS    *((WORD  *)((char  *)aline + (char  *) -6L))
  312. #define FONTOFFTABLE    *((char **)((char **)aline + (char **)-10L))
  313. #define MAXX        *((WORD  *)((char  *)aline + (char  *)-12L))
  314. #define FONTWIDTH    *((WORD  *)((char  *)aline + (char  *)-14L))
  315. #define FIRSTADE    *((WORD  *)((char  *)aline + (char  *)-16L))
  316. #define    LASTADE        *((WORD  *)((char  *)aline + (char  *)-18L))
  317. #define FONTDATA    *((char **)((char **)aline + (char **)-22L))
  318. #define    CURTIMER    *((char  *)((char  *)aline + (char  *)-23L))
  319. #define CURINTERVAL    *((char  *)((char  *)aline + (char  *)-24L))
  320. #define CURX        *((WORD  *)((char  *)aline + (char  *)-26L))
  321. #define    CURY        *((WORD  *)((char  *)aline + (char  *)-28L))
  322. #define    FSTOFFSET    *((WORD  *)((char  *)aline + (char  *)-30L))
  323. #define    CURADDRESS    *((char **)((char **)aline + (char **)-34L))
  324. #define    FGCOLOR        *((WORD  *)((char  *)aline + (char  *)-36L))
  325. #define    BGCOLOR        *((WORD  *)((char  *)aline + (char  *)-38L))
  326. #define    NOFFSET        *((WORD  *)((char  *)aline + (char  *)-40L))
  327. #define    CELLSHIGH    *((WORD  *)((char  *)aline + (char  *)-42L))
  328. #define    CELLSACROSS    *((WORD  *)((char  *)aline + (char  *)-44L))
  329. #define    CELLHEIGHT    *((WORD  *)((char  *)aline + (char  *)-46L))
  330.  
  331.  
  332.     /* A pointer to array of type FONT is returned by the Line A init call
  333.      * ($A000), in regsister A1.
  334.          * This pointer is saved in the global array variable 'fnt'.
  335.      *
  336.      */
  337.  
  338. typedef struct _font {
  339.  
  340. /* Type    Name       Offset   Function            Comments              */
  341. /* -------------------------------------------------------------------------  */
  342.    WORD   face_id;    /*  0 Font face identifier  1 == system font            */
  343.                       /*                                                      */
  344.    WORD   size;       /*  2 Font size in points                               */
  345.                       /*                                                      */
  346.    char   name[32];   /*  4 Face name                                         */
  347.                       /*                                                      */
  348.    WORD   first_ade;  /* 36 Lowest ADE value in the face (lowest ASCII value  */
  349.                       /*    of displayable character).                        */
  350.                       /*                                                      */
  351.    WORD   last_ade;   /* 38 Highest ADE value in the face (highest ASCII value*/
  352.                       /*    of displayable character).                        */
  353.                       /*                                                      */
  354.    WORD   top;        /* 40 Distance of top line relative to baseline         */
  355.                       /*                                                      */
  356.    WORD   ascent;     /* 42 Distance of ascent line relative to baseline      */
  357.                       /*                                                      */
  358.    WORD   half;       /* 44 Distance of half line relative to baseline        */
  359.                       /*                                                      */
  360.    WORD   descent;    /* 46 Distance of decent line relative to baseline      */
  361.                       /*                                                      */
  362.    WORD   bottom;     /* 48 Distance of bottom line relative to baseline      */
  363.                       /*    All distances are measured in absolute values     */
  364.                       /*    rather than as offsets. They are always +ve       */
  365.                       /*                                                      */
  366.    WORD   wchar;      /* 50 Width of the widest character in font             */
  367.                       /*                                                      */
  368.    WORD   wcell;      /* 52 Width of the widest cell character cell in face   */
  369.                       /*                                                      */
  370.    WORD   left_off;   /* 54 Left Offset see Vdi appendix G                    */
  371.                       /*                                                      */
  372.    WORD   right_off;  /* 56 Right offset   "      "     "                     */
  373.                       /*                                                      */
  374.    WORD   thicken;    /* 58 Number of pixels by which to thicken characters   */
  375.                       /*                                                      */
  376.    WORD   underline;  /* 60 Width in  pixels of the underline                 */
  377.                       /*                                                      */
  378.    WORD   lighten;    /* 62 The mask used to lighten characters               */
  379.                       /*                                                      */
  380.    WORD   skew;       /* 64 The mask used to determine when to perform        */
  381.                       /*    additional rotation on the character to perform   */
  382.                       /*    skewing                                           */
  383.                       /*                                                      */
  384.    WORD   flags;      /* 66 Flags                                             */
  385.                       /*      bit 0 set if default system font                */
  386.                       /*      bit 1 set if horiz offset table should be used  */
  387.                       /*      bit 2 byte-swap flag (thanks to Intel idiots)   */
  388.                       /*      bit 3 set if mono spaced font                   */
  389.                       /*                                                      */
  390.    WORD   *h_offset;  /* 68 Pointer to horizontal offset table                */
  391.                       /*                                                      */
  392.    WORD   *off_table; /* 72 Pointer to character offset table                 */
  393.                       /*                                                      */
  394.    char   *data;      /* 76 Pointer to font data                              */
  395.                       /*                                                      */
  396.    WORD   width;      /* 80 Form width (#of bytes /scanline in font data)     */
  397.                       /*                                                      */
  398.    WORD   height;     /* 82 Form height (#of scanlines in font data)          */
  399.                       /*                                                      */
  400.  struct _font *next;  /* 84 Pointer to next font in face                      */
  401.                       /*                                                      */
  402. /* -------------------------------------------------------------------------  */
  403. } FONT;
  404.  
  405.     
  406.     /*
  407.      * OP_TAB type required for Bit Blt parameter block.
  408.      * each entry defines the logic operation to apply for
  409.      * the 4 Fore/Back ground bit combinations
  410.      */
  411. typedef struct {
  412.  
  413. /* Type    Name       Offset   Function            Comments              */
  414. /* -------------------------------------------------------------------------  */
  415.    char   fg0bg0;     /* 0    Logic op to employ when both FG and BG are 0  */
  416.    char   fg0bg1;     /* 1    Logic op to employ when FG = 0 and BG = 1     */
  417.    char   fg1bg0;     /* 2    Logic op to employ when FG = 1 and BG = 0     */
  418.    char   fg1bg1;     /* 3    Logic op to employ when both FG and BG are 1  */
  419. /* -------------------------------------------------------------------------  */
  420. } OP_TAB;
  421.  
  422.  
  423. /*
  424.  * Source and destination description blocks
  425.  */
  426. typedef struct  {
  427.     WORD    bl_xmin;        /* Minimum x            */
  428.     WORD    bl_ymin;        /* Minimum y             */
  429.     char    *bl_form;        /* Word aligned memory form     */
  430.     WORD    bl_nxwd;        /* Offset to next word in line  */
  431.     WORD     bl_nxln;        /* Offset to next line in plane */
  432.     WORD     bl_nxpl;        /* Offset to next plane     */
  433. }SDDB;
  434.  
  435.     /* Offsets to next word in plane */
  436. #define HI_NXWD        2
  437. #define MED_NXWD    4
  438. #define LOW_NXWD    8
  439.  
  440.     /* Scan line widths of the screen */
  441. #define HI_NXLN        80
  442. #define MED_NXLN    160
  443. #define LOW_NXLN    160
  444.  
  445.     /*
  446.      * Offsets between planes - always the same due to
  447.      * the way the STs video memory is laid out
  448.          */
  449. #define NXPL        2
  450.  
  451.     /* 
  452.      * Bit Blt Parameter Block Type (for function $A007)
  453.      *
  454.      */
  455.  
  456. typedef struct {
  457.  
  458. /* Type    Name           Offset   Function            Comments          */
  459. /* -------------------------------------------------------------------------  */
  460.    WORD       bb_b_wd;     /*     width of block in pixels               */
  461.    WORD       bb_b_ht;     /*     height of block in pixels              */
  462.    WORD       bb_plane_ct; /*     number of planes to blit               */
  463.    WORD       bb_fg_col;   /*     foreground color                   */
  464.    WORD       bb_bg_col;   /*     back    ground color                   */
  465.    OP_TAB  bb_op_tab;   /*     logic for fg x bg combination               */
  466.    SSDB       bb_s;        /*     source info block                  */
  467.    SSDB       bb_d;        /*     destination info block               */
  468.    WORD       *bb_p_addr;  /*     pattern buffer address               */
  469.    WORD       bb_p_nxln;   /*     offset to next line in pattern           */
  470.    WORD       bb_p_nxpl;   /*     offset to next plane in pattern           */
  471.    WORD       bb_p_mask;   /*     pattern index mask                   */
  472.    char       bb_fill[24];    /*     work space                      */
  473. /* -------------------------------------------------------------------------  */
  474. } BBPB;
  475.  
  476.  
  477. /*
  478.  * Memory Form Definition Block
  479.  *
  480.  */
  481. typedef struct
  482. {
  483.     char        *fd_addr;    /* Addrerss of upper left corner of first*/
  484.                                      /* plane of raster area. If NULL then    */
  485.                                      /* MFDB is for a physical device         */
  486.     WORD        fd_w;         /* Form Width in Pixels                  */
  487.     WORD        fd_h;        /* Form Height in Pixels                 */
  488.     WORD        fd_wdwidth;  /* Form Width in words (fd_w/sizeof(int))*/
  489.     WORD        fd_stand;    /* Form format 0= device spec 1=standard */
  490.     WORD        fd_nplanes;  /* Number of memory planes               */
  491.     WORD        fd_r1;       /* Reserved                              */
  492.     WORD        fd_r2;       /* Reserved                              */
  493.     WORD        fd_r3;       /* Reserved                              */
  494. } MFDB;
  495.  
  496.  
  497.  
  498.  
  499. /*
  500.  * Sprite definition block
  501.  *
  502.  */
  503. typedef struct
  504. {
  505.     WORD    sp_xhot;        /* Offset to X hot spot        */
  506.     WORD    sp_yhot;        /* Offset to Y hot spot        */
  507.     WORD    sp_format;        /* Format SP_VDI or SP_XOR     */
  508.     WORD    sp_bg;            /* Background color        */
  509.     WORD    sp_fg;            /* Foregroud color        */
  510.     WORD    sp_data[32];        /* Sprite data -         */
  511.                     /* Alternating words of back/fore */
  512.                     /* ground data              */
  513.                     /* Note that:              */
  514.                     /*   sprite save block is         */
  515.                     /*  10+VPLANES*64 bytes long      */
  516.  
  517. } SFORM;
  518.  
  519.  
  520. /*
  521.  * Macros for the most reasonable linea functions.
  522.  * All the rest require a long discussion.
  523.  
  524. /*****************************************************************************\
  525. *                                                                      *
  526. *                  Macros for some Line A functions                  *
  527. *                                                                      *
  528. \*****************************************************************************/
  529.  
  530. #define putpixel(x,y,v)    ((PTSIN[0]=x),(PTSIN[1]=y),(INTIN[0]=v),linea1())
  531. #define getpixel(x,y)    ((PTSIN[0]=x),(PTSIN[1]=y),linea2())
  532. #define SABORT_FUNC    funcs[FSEEDFILL]
  533.  
  534. /*****************************************************************************\
  535. *                                                                      *
  536. *                             Global Variables                      *
  537. *                                                                      *
  538. \*****************************************************************************/
  539.  
  540.     /*
  541.      * Global Variables are defined in alglobal.c, extern every where else
  542.      *
  543.      */
  544. #ifndef ALGLOBAL
  545.  
  546. extern LINEA *aline;    /* Pointer to line a parameter block returned by init */
  547.  
  548. extern FONT  *fonts[];    /* Array of pointers to the three system font headers */
  549.             /* returned by init (in register A1)              */
  550.  
  551. extern WORD  (*funcs[])(); /* Array of pointers to the 15 line a functions    */
  552.                /* returned by init (in register A2)              */
  553.                /* only valid in ROM'ed TOS                  */
  554. #endif /* ALGLOBAL */
  555.